// TextImporter.cpp: implementation of the CTextImporter class.
//
//////////////////////////////////////////////////////////////////////
#include "Common.h"
#include "TextImporter.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CTextImporter::CTextImporter(wchar_t* file)
:
	CImporter(file, L"r")
{
	char	buff[100];
	res = -1;

	// find out width/height
	fgets(buff, 98, m_inFile);
	
//	_wcslwr_s_l();
	_strlwr(buff);

	int x;

	x = sscanf(buff, "width %d\n", &m_Width);
	x = sscanf(buff, "height %d\n", &m_Width);
	if(x == 0)
	{
		fgets(buff, 98, m_inFile);
		x = sscanf(buff, "%d\n", &m_Width);
		if(x == 0)
		{
			res = ERR_FILE_FORMAT;
			return;
		}
	}
}

CTextImporter::~CTextImporter()
{

}

int CTextImporter::GetWidth()
{
	return -1;	
}

int CTextImporter::GetHeight()
{
	return -1;	
}

